package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 证件类型
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum UserBaseIdentityType implements BaseEnum<Integer> {

    /** 证件类型-身份证 */
    ID_CARD(1, "身份证"),
    /** 证件类型-护照 */
    PASSPORT(2, "护照");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static UserBaseIdentityType getByCode(Integer code) {
        return BaseEnum.getByCode(UserBaseIdentityType.class, code);
    }

    @JsonCreator
    public static UserBaseIdentityType getByName(String name) {
        return BaseEnum.getByName(name, UserBaseIdentityType.class);
    }

}
